package com.market.order.common.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.market.common.core.annotation.Excel;
import com.market.common.core.web.domain.BaseEntity;

/**
 * 订单明细表对象 t_order_detail
 *
 * @author market
 * @date 2024-02-26
 */
public class TOrderDetail extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private Integer id;

    /** 订单id */
    @Excel(name = "订单id")
    private Integer orderId;

    /** 商品id */
    @Excel(name = "商品id")
    private Integer productId;

    /** 购买数量 */
    @Excel(name = "购买数量")
    private Integer productQuantity;

    /** 商品价格 */
    @Excel(name = "商品价格")
    private BigDecimal productPrice;

    /** 小计（价格*数量） */
    @Excel(name = "小计", readConverterExp = "价=格*数量")
    private BigDecimal subTotal;

    /** 优惠券id */
    @Excel(name = "优惠券id")
    private Integer coupon;

    /** 商家id */
    @Excel(name = "商家id")
    private Integer userId;

    /** 下单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date orderTime;

    /*收货地址*/
    private Integer deliveryAddress;
    /*
    *商品名称
     * */
    private String name;
    /*
    * sku
    * */
    private String sku;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSku() {
        return sku;
    }

    public void setSku(String sku) {
        this.sku = sku;
    }

    public Integer getDeliveryAddress() {
        return deliveryAddress;
    }

    public void setDeliveryAddress(Integer deliveryAddress) {
        this.deliveryAddress = deliveryAddress;
    }

    /** 实际价格 */
    @Excel(name = "实际价格")
    private BigDecimal actualPrice;

    public void setId(Integer id)
    {
        this.id = id;
    }

    public Integer getId()
    {
        return id;
    }
    public void setOrderId(Integer orderId)
    {
        this.orderId = orderId;
    }

    public Integer getOrderId()
    {
        return orderId;
    }
    public void setProductId(Integer productId)
    {
        this.productId = productId;
    }

    public Integer getProductId()
    {
        return productId;
    }
    public void setProductQuantity(Integer productQuantity)
    {
        this.productQuantity = productQuantity;
    }

    public Integer getProductQuantity()
    {
        return productQuantity;
    }
    public void setProductPrice(BigDecimal productPrice)
    {
        this.productPrice = productPrice;
    }

    public BigDecimal getProductPrice()
    {
        return productPrice;
    }
    public void setSubTotal(BigDecimal subTotal)
    {
        this.subTotal = subTotal;
    }

    public BigDecimal getSubTotal()
    {
        return subTotal;
    }
    public void setCoupon(Integer coupon)
    {
        this.coupon = coupon;
    }

    public Integer getCoupon()
    {
        return coupon;
    }
    public void setUserId(Integer userId)
    {
        this.userId = userId;
    }

    public Integer getUserId()
    {
        return userId;
    }
    public void setOrderTime(Date orderTime)
    {
        this.orderTime = orderTime;
    }

    public Date getOrderTime()
    {
        return orderTime;
    }
    public void setActualPrice(BigDecimal actualPrice)
    {
        this.actualPrice = actualPrice;
    }

    public BigDecimal getActualPrice()
    {
        return actualPrice;
    }


    public TOrderDetail() {
    }

    public TOrderDetail(Integer id, Integer orderId, Integer productId, Integer productQuantity, BigDecimal productPrice, BigDecimal subTotal, Integer coupon, Integer userId, Date orderTime, Integer deliveryAddress, String name, String sku, BigDecimal actualPrice) {
        this.id = id;
        this.orderId = orderId;
        this.productId = productId;
        this.productQuantity = productQuantity;
        this.productPrice = productPrice;
        this.subTotal = subTotal;
        this.coupon = coupon;
        this.userId = userId;
        this.orderTime = orderTime;
        this.deliveryAddress = deliveryAddress;
        this.name = name;
        this.sku = sku;
        this.actualPrice = actualPrice;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderId", getOrderId())
            .append("productId", getProductId())
            .append("productQuantity", getProductQuantity())
            .append("productPrice", getProductPrice())
            .append("subTotal", getSubTotal())
            .append("coupon", getCoupon())
            .append("userId", getUserId())
            .append("orderTime", getOrderTime())
            .append("actualPrice", getActualPrice())
                .append("deliveryAddress",getDeliveryAddress())
                .append("name",getName())
                .append("sku",getSku())
            .toString();
    }
}
